<script setup>
import {getCurrentInstance} from "vue";
import {onHide, onLaunch, onShow} from "@dcloudio/uni-app";
import chat from './common/chat'

const { proxy } = getCurrentInstance();

onLaunch(() =>{
  console.log('App Launch')
  // 缓存获取用户信息
  proxy.$global.user_id = uni.getStorageSync('user_id')||'';
  proxy.$global.phone = uni.getStorageSync('phone')||'';
  proxy.$global.userInfo = uni.getStorageSync('userInfo')||{};
  if(proxy.$global.user_id){
    chat.connect();
    chat.getUnreadMessage();
  }
  uni.hideTabBar();
})
onShow(() =>{
  console.log('App Show')
})
onHide(() =>{
  console.log('App Hide')
})
</script>

<style lang="scss">
/*每个页面公共css */
/* 右箭头更多 */
.right-arrows{
  width: 16rpx;
  height: 16rpx;
  border-right: 2rpx solid #666666;
  border-bottom: 2rpx solid #666666;
  transform: rotate(-45deg);
}
/* 超出一行省略号 */
.one-omit {
  white-space: nowrap; /*规定段落中的文本不进行换行*/
  overflow: hidden; /*内容会被修剪，并且其余内容是不可见的。*/
  text-overflow: ellipsis; /*显示省略号来代表被修剪的文本*/
}

.two-omit {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
}
</style>
